package com.ww.springstudy.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-06-29 16:34
 */
@Aspect
@Component
public class ListenerAspect {


    @Pointcut("@annotation(MyListener)")
    public void mqAroundPointCut() {
    }

    //进入切面后处理
    @Around("mqAroundPointCut()")
    public Object aroundAdvice(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("------------切面前");
        Object proceed = pjp.proceed();
        System.out.println("------------切面后");
        return proceed;
    }
}
